<template>
  <view class="container">
    <view class="title">待办事项管理</view>
    <view class="input-group">
      <input type="text" placeholder="请输入用户名" v-model="username" />
      <input type="password" placeholder="请输入密码" v-model="password" />
    </view>
    <button @click="login">登录</button>
    <view class="link" @click="navigateToRegister">没有账号？注册一个</view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      username: '',
      password: ''
    };
  },
  methods: {
    login() {
      // 登录逻辑处理
      console.log("登录", this.username, this.password);
      // 在此处加入实际的登录验证逻辑
      // 如果登录成功，导航到首页
      uni.navigateTo({
        url: '/pages/home/index'
      });
    },
    navigateToRegister() {
      // 导航到注册界面
      uni.navigateTo({
        url: '/pages/register/index'
      });
    }
  }
}
</script>

<style scoped>
.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background-color: #333;
}

.title {
  font-size: 24px;
  color: white;
  margin-bottom: 40px;
}

.input-group input {
  width: 80%;
  padding: 12px;
  margin-bottom: 10px;
  border: none;
  border-radius: 4px;
  background-color: #444;
  color: #ddd;
}

button {
  width: 80%;
  padding: 12px;
  background-color: #555;
  color: white;
  border: none;
  border-radius: 4px;
}

button:hover {
  background-color: #666;
}

.link {
  margin-top: 20px;
  color: #999;
  cursor: pointer;
}
</style>
